Imports CrystalDecisions.CrystalReports.Engine

Public Class FrmCrTonNganHang
    Private customerReport As ReportDocument
    Private nam As String

    Private Sub FormCrTonNganHang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        moduleUtils.setDinhDangVietNam()
        Dim sqlQuery As String = "SELECT recycleId, sum(tiendauky) as TienDauKy, "
        sqlQuery += "sum(tienthu) as tienThu, sum(tienchi) as tienChi, "
        sqlQuery += "sum(tienton) as tienTon FROM tbl_dot_tonnganhang "
        sqlQuery += "WHERE recycleId LIKE '" & nam & "%' "
        sqlQuery += "group by recycleID ORDER BY recycleID"

        Dim reportPath = Application.StartupPath & "\" & "CrTonNganHang.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        Me.crTonNganHangView.ReportSource = customerReport
    End Sub

    Public Sub setNam(ByVal s As String)
        nam = s
    End Sub
End Class